﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

public class BUS_Category : DAL_Category
{
    DataTable dtC = new DataTable();
    public DataTable Category_getData()
    {
        try
        {
            dtC = DAL_Category_getData();
        }
        catch
        {
        }
        return dtC;
    }
    public DataTable Category_getAllData()
    {
        try
        {
            dtC = DAL_Category_getAllData();
        }
        catch
        {
        }
        return dtC;
    }
    public DataTable Category_getMaxOrder()
    {
        try
        {
            dtC = DAL_Category_getMaxOrder();
        }
        catch
        {
        }
        return dtC;
    }
    public DataTable Category_getMinCgid()
    {
        try
        {
            dtC = DAL_Category_getMinCgid();
        }
        catch
        {
        }
        return dtC;
    }
    public DataTable Category_getById(int Id)
    {
        try
        {
            dtC = DAL_Category_getById(Id);
        }
        catch
        {
        }
        return dtC;
    }
    public DataTable Category_getAllById(int Id)
    {
        try
        {
            dtC = DAL_Category_getAllById(Id);
        }
        catch
        {
        }
        return dtC;
    }
    public DTO_Category LoadCategory(int cgid)
    {
        DTO_Category dtoC = new DTO_Category();
        try
        {
            dtoC = DAL_LoadCategory(cgid);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        return dtoC;
    }
    public Boolean Category_addtodel(int id)
    {
        try
        {
            DAL_Category_addtodel(id);
        }
        catch
        {
            return false;
        }
        return true;
    }
    public Boolean Category_del()
    {
        try
        {
            DAL_Category_del();
        }
        catch
        {
            return false;
        }
        return true;
    }
    public Boolean Category_Update(DTO_Category obj)
    {
        try
        {

            if (DAL_Category_Update(obj))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        catch
        {
            return false;
        }
    }
    public Boolean Category_Insert(DTO_Category obj)
    {
        try
        {

            if (DAL_Category_Insert(obj))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        catch
        {
            return false;
        }
    }
}